home *** CD-ROM | disk | FTP | other *** search
- <!-- sb2buyitem Buy item and clear basket -->
- <!-- (c) Copyright 2001 GS Software -->
- <!-- -->
- <SCRIPT LANGUAGE="JavaScript">
- {tagsoff}
-
- function buyItem(newItem, newPrice, newQuantity , price1, price2, qty1, qty2 , textin, Attribut1, Attribut2, Attribut3, productvatrate)
- {
- newItem = unescape(newItem);
- var index=-1;
- if (! Attribut1) {Attribut1=""};
- if (! Attribut2) {Attribut2=""};
- if (! Attribut3) {Attribut3=""};
- if (! price1) {price1="0"};
- if (! price2) {price2="0"};
- if (! qty1) {qty1="0"};
- if (! qty2) {qty2="0"};
- if (! textin) {textin=""};
-
-
- {tagson}
- if (!( (parseFloat(newQuantity) == parseInt(newQuantity) )&&( parseInt(newQuantity) > 0) ) || isNaN(newQuantity))
- alert(Loc_Integer);
- else
- {
- if(Attribut1.substr(Attribut1.length-1,1)=='?')
- alert(Loc_Please+ Attribut1.substr(0,Attribut1.length-1)+Loc_Select);
- else
- {
- if(Attribut2.substr(Attribut2.length-1,1)=='?')
- alert(Loc_Please+ Attribut2.substr(0,Attribut2.length-1)+Loc_Select);
- else
- {
- if(Attribut3.substr(Attribut3.length-1,1)=='?')
- alert(Loc_Please+ Attribut3.substr(0,Attribut3.length-1)+Loc_Select);
- else
- {
- if(confirm(newQuantity+' x '+newItem+'{ORDERDIALOGTEXT}'))
- {
- for (var i=1; i<= theBasket.length-1; i++)
- {
- if ((theBasket[i].Item==newItem)&&(theBasket[i].Attribut1==Attribut1)&&(theBasket[i].Attribut2==Attribut2)&&(theBasket[i].Attribut3==Attribut3))
- {
- if (window.confirm(Loc_Add))
- theBasket[i].Quantity=parseInt(theBasket[i].Quantity)+parseInt(newQuantity);
- else
- theBasket[i].Quantity=newQuantity
-
- theBasket[i].Textin=textin;
- index=i;
- }
- }
-
- if (index<0)
- {
- var neuItem=new BasketItem(newItem,newPrice,price1,price2,qty1,qty2,newQuantity,textin, Attribut1, Attribut2, Attribut3, productvatrate);
- // var neuItem=new BasketItem(newItem,newPrice,price1,price2,qty1,qty2,newQuantity,textin, Attribut1, Attribut2, Attribut3);
- theBasket=theBasket.concat([neuItem]);
- }
- }
- basketframe.location = "permbasket.htm";
- }
- }
- }
- }
- }
-
-
- function resetShoppingBasket()
- {
- theBasket=theBasket.slice(0,1);
- }
-
- {tagson}
-
- </SCRIPT>